Automatically unlock main branch after release publishes#7416
Closed
Conversation
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
3 tasks
Adds a final step in the changeset-release job that flips the lockBranch field on the main branch protection rule back to false once a release publishes successfully. The pre-release lock is still applied manually; only the unlock is automated for now. The step requires a RELEASE_ADMIN_TOKEN secret (PAT or GitHub App installation token with admin permissions on branch protection). If the secret is not configured, the step warns and skips so it never blocks a release. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
854615f to
fb9e6f5
Compare
3a1b640 to
6780212
Compare
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
changeset-releasejob that flipslockBranchback tofalseon themainbranch protection rule once a release publishes successfully.hasChangesets == 'false'(release was just published) andgithub.ref_name == 'main', so it doesn't run on stable branches or on the version-PR creation pass.Token requirement
The default
GITHUB_TOKENcannot modify branch protection rules. The step uses a separateRELEASE_ADMIN_TOKENsecret (PAT or GitHub App installation token withAdministration: writeon the repo). If the secret is not configured, the step emits a::warning::and exits 0 without failing the workflow — meaning this is safe to merge before the secret is provisioned, and the unlock will simply remain manual until then.Stacked on top of #7415.
Test plan
RELEASE_ADMIN_TOKENsecret in the repomainmanually via the GitHub UI before the next releaselockBranchback tofalseafter the release publisheslockBranch: false🤖 Generated with Claude Code